
import java.awt.*;
import javax.swing.*;
import javax.swing.border.LineBorder;

public class SouthPanel extends JPanel
{	
	private CornerLot Jail;
	private PropertyLot ConnecticutAve;
	private PropertyLot VermontAve;
	private CardDrawLot Chance;
	private PropertyLot OrientalAve;
	private RailroadLot ReadingRailroad;
	private TaxLot IncomeTax;
	private PropertyLot BalticAve;
	private CardDrawLot Chest;
	private PropertyLot MediterraneanAve;
	private CornerLot Go;
	
	public SouthPanel()
	{
		Color darkpurple = new Color(94,55,122);		
		setLayout(new BoxLayout(this, BoxLayout.X_AXIS));
		setBackground(Color.white);		
		
		Jail = new CornerLot("Jail", "corner", "southwest");		
		ConnecticutAve = new PropertyLot("ConnecticutAve", "property", "south", 120, Color.CYAN,
										 8, 40, 100, 300, 450, 600, 60, 50, 50);
		VermontAve = new PropertyLot("VermontAve", "property", "south", 100, Color.CYAN,
									 6, 30, 90, 270, 400, 550, 50, 50, 50);
		Chance = new CardDrawLot("ChanceSouth", "cardDraw", "south", "Chance", 1);
		OrientalAve = new PropertyLot("OrientalAve", "property", "south", 100, Color.CYAN,
				 					  6, 30, 90, 270, 400, 550, 50, 50, 50);
		ReadingRailroad = new RailroadLot("ReadingRailroad", "railroad", "south");
		IncomeTax = new TaxLot("IncomeTax", "tax", "south");
		BalticAve = new PropertyLot("BalticAve", "property", "south", 60, darkpurple,
				  4, 20, 60, 180, 320, 450, 30, 50, 50);
		Chest = new CardDrawLot("ChestSouth", "cardDraw", "south", "CommunityChest", 1);
		MediterraneanAve = new PropertyLot("MediterraneanAve", "property", "south", 60, darkpurple,
				  2, 10, 30, 90, 160, 250, 30, 50, 50);
		Go = new CornerLot("Go", "corner", "southeast");
		
		add(Jail);
		add(ConnecticutAve);
		add(VermontAve);
		add(Chance);
		add(OrientalAve);
		add(ReadingRailroad);
		add(IncomeTax);
		add(BalticAve);
		add(Chest);
		add(MediterraneanAve);
		add(Go);	
	} // end SouthPanel constructor	
	
	public void buildHouses(int num, String name)
	{
		if(name == "MediterraneanAve")
		{
			MediterraneanAve.setNumHouses(num);
		}
		else if(name == "BalticAve")
		{
			BalticAve.setNumHouses(num);
		}
		else if(name == "OrientalAve")
		{
			OrientalAve.setNumHouses(num);
		}
		else if(name == "VermontAve")
		{
			VermontAve.setNumHouses(num);
		}
		else if(name == "ConnecticutAve")
		{
			ConnecticutAve.setNumHouses(num);
		}
	}
	
	public void removeAllHouses(String name)
	{
		if(name == "MediterraneanAve")
		{
			MediterraneanAve.setNumHouses(0);
		}
		else if(name == "BalticAve")
		{
			BalticAve.setNumHouses(0);
		}
		else if(name == "OrientalAve")
		{
			OrientalAve.setNumHouses(0);
		}
		else if(name == "VermontAve")
		{
			VermontAve.setNumHouses(0);
		}
		else if(name == "ConnecticutAve")
		{
			ConnecticutAve.setNumHouses(0);
		}
	}
	
	public void buildHotel(String name)
	{
		if(name == "MediterraneanAve")
		{
			MediterraneanAve.setNumHotels(1);
		}
		else if(name == "BalticAve")
		{
			BalticAve.setNumHotels(1);
		}
		else if(name == "OrientalAve")
		{
			OrientalAve.setNumHotels(1);
		}
		else if(name == "VermontAve")
		{
			VermontAve.setNumHotels(1);
		}
		else if(name == "ConnecticutAve")
		{
			ConnecticutAve.setNumHotels(1);
		}
	}
	
	public void updateBoard()
	{
		OrientalAve.updateBoard();
		VermontAve.updateBoard();
		ConnecticutAve.updateBoard();
	}
	
	
	
} // end class SouthPanel
